import AuthState from './AuthState'
import {ACTION_TYPES} from '../action/ActionTypes'

const INITIAL_STATE: AuthState = {}

function authReducers(
  state: AuthState = INITIAL_STATE,
  action: {type: string; [key: string]: any},
) {
  switch (action.type) {
    case ACTION_TYPES.AUTH_SET_STATE: {
      return {
        ...state,
        ...action.state,
      }
    }
    default: {
      return {
        ...state,
      }
    }
  }
}

export {authReducers}
